#!/bin/ksh
MYMONTH=`date +%m`
MYDAY=`date +%d`
MYLASTDAY=`expr $MYDAY - 2`
DAYSTAMP=${MYMONTH}${MYLASTDAY}
errpt -d H|grep -v IDENTIFIER|awk '{if (substr($2,1,4)>daystamp) print $0 }' daystamp=$DAYSTAMP >err.txt
MYCOUNT=`cat err.txt|wc -l`
if [[ $MYCOUNT -eq 0 ]];then
 echo No Hardware error has found !
else
 echo "IDENTIFIER TIMESTAMP  T C RESOURCE_NAME  DESCRIPTION"
 cat err.txt
fi
rm /home/monitor/err.txt
exit 0
